<?php 
include_once 'utiles.php';
include_once '../phpexcel/PHPExcel.php'; 


date_default_timezone_set('America/Buenos_Aires');
setlocale(LC_ALL,"es_AR");
$fechaReporte = strftime("%d / %m / %Y");

$reporte = new PHPExcel(); 
$reporte->setActiveSheetIndex(0)->setCellValue("F2","TITULO"); 
$reporte->setActiveSheetIndex(0)->setCellValue("F4","Sres : AGUAS SANTAFESINAS S.A."); 
$reporte->setActiveSheetIndex(0)->setCellValue("F5","RENDICION ORDENES DE TRABAJO"); 
$reporte->setActiveSheetIndex(0)->setCellValue("I4","Fecha de emision"); 
$reporte->setActiveSheetIndex(0)->setCellValue("I5",$fechaReporte); 

$style['titulo'] = array('name' => 'Calibri','size' => 20);
$style['subtitulo'] = array('name' => 'Calibri','size' => 11);
$style['label'] = array('name' => 'Calibri','size' => 11);
$style['data'] = array('name' => 'Calibri','size' => 9);

$reporte->getActiveSheet()->setTitle("Rendicion OT"); 

$reporte->getActiveSheet()->getPageSetup()->setOrientation(PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE);
$reporte->getActiveSheet()->getPageSetup()->setPaperSize(PHPExcel_Worksheet_PageSetup::PAPERSIZE_A4);

$reporte->getDefaultStyle()->getFont()
    ->setName('Calibri')
    ->setSize(9);

$reporte->getActiveSheet()
    ->getStyleByColumnAndRow(5, 2)
    ->getFont()
    ->applyFromArray($style['titulo']);

$reporte->getActiveSheet()
    ->getStyleByColumnAndRow(5, 4)
    ->getFont()
    ->applyFromArray($style['subtitulo']);

$reporte->getActiveSheet()
    ->getStyleByColumnAndRow(5, 5)
    ->getFont()
    ->applyFromArray($style['subtitulo']);

$reporte->getActiveSheet()
    ->getStyleByColumnAndRow(12, 4)
    ->getFont()
    ->applyFromArray($style['subtitulo']);

$reporte->getActiveSheet()
    ->getStyleByColumnAndRow(12, 5)
    ->getFont()
    ->applyFromArray($style['subtitulo']);

$sheet = $reporte->getActiveSheet();

$objDrawing = new PHPExcel_Worksheet_Drawing();
$objDrawing->setName('Logo');
$objDrawing->setDescription('Logo');
$logo = 'images/logo.png'; // Provide path to your logo file
$objDrawing->setPath($logo);
$objDrawing->setOffsetX(8);    // setOffsetX works properly
$objDrawing->setOffsetY(300);  //setOffsetY has no effect
$objDrawing->setCoordinates('B1');
$objDrawing->setHeight(75); // logo height
$objDrawing->setWorksheet($sheet); 


?>